import {create} from 'zustand'

type LayoutMode = 'three' | 'two' | 'one'
type AppPage = 'dataSourceCenter'

interface AppState {
  // 页面选择
  selectedPage: AppPage
  setSelectedPage: (page: AppPage) => void

  // 数据源中心内部布局
  layoutMode: LayoutMode
  setLayoutMode: (mode: LayoutMode) => void
}

export const useAppStore = create<AppState>((set) => ({
  selectedPage: 'dataSourceCenter',
  setSelectedPage: (page) => set({ selectedPage: page }),

  layoutMode: 'three',
  setLayoutMode: (mode) => set({ layoutMode: mode })
}))